package com.tianyu.sports.utils;


import com.tianyu.sports.bean.Result;

/**
 * @author Jzen
 */
public class ResultUtil {

    public static Result success(Object object) {
        Result result = new Result();
        result.setCode(0);
        result.setMsg("OK");
        result.setData(object);
        return result;
    }

    public static Result success() {
        return success(null);
    }

    public static Result error() {
        Result result = new Result();
        result.setCode(-1);
        result.setMsg("ERROR");
        return result;
    }

    public static Result error(Integer code, String msg) {
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

}
